﻿@model IEnumerable<Student>
@{
    ViewBag.Title = "学生列表页面";

}

<div class="card-group">
    @foreach (var student in Model)
    {
        var photoPath = "~/Images/" + (student.PhotoPath ?? "timg.jpg");
        <div class="card m-3">
            <div class="card-header">
                <h3 class="card-title">@student.Name</h3>
            </div>
            <img class="card-img-top imagesThumbnail" src="@photoPath" asp-append-version="true">
            @*<div class="card-body text-center">
                    <h5>主修科目：@student.Major </h5>
                </div>*@

            <div class="card-footer text-center">
                <a asp-controller="home" asp-action="details" asp-route-id="@student.ID" class="btn btn-primary m-1">查看</a>
                <a asp-controller="home" asp-action="edit" asp-route-id="@student.ID" class="btn btn-primary">编辑</a>
                <a asp-controller="home" asp-action="delete" asp-route-id="@student.ID" class="btn btn-danger">删除</a>
            </div>
        </div>
    }
</div>

